
$(function () {
   
    //保存
    $("[name='btn_save']").click(function () {
    	var form = window.form_new_generalset;
    	var setuptype = $("[name='setuptype']");
    	var list = new Array();
    	for(var i =0 ;i<setuptype.length ;i++){
    		var id = setuptype[i].id;
    		var value = setuptype[i].value;
    		var setupvalue ="";
    		if(value=="0"){
    			setupvalue = $("#setupvalue_"+id).val();
    		}else{
    			setupvalue = $('input:radio[name="setupvalue_'+id+'"]:checked').val();
    		}
    		//var setupdescribe = $("#setupdescribe_"+id).val();
    		var json = {};
    		json.id = id;
    		json.setupvalue = setupvalue;
    		//json.setupdescribe = setupdescribe;
    		list.push(json);
    	}
    	
        var generalset = {List: list};

        $.putJsonBody("/generalset/save" , generalset, function (re) {
        	window.location.href=window.location.href; 
        	window.location.reload; 
        })
    });
   

    //数据导出
    $("[name='btn_export']").click(function () {
    	bootbox.bconfirm("确定是否导出？", function (re) {
            if (re) {
            	 var url="/generalset/export";
                 window.open(url);
            }
        });
    });
    
    
});